﻿@using DataMongo
@using MVCMongo.Services
@model MVCMongo.ViewModel.ProfileIndexViewModel
@{
    ViewBag.Title = "Group";
    Layout = "~/Views/Shared/_LayoutProfile.cshtml";
    var list = ViewBag.FriendList as List<int>;
}

<div class="container-fluid">
    <div class="row-fluid">

        <div class="box box-bordered box-small">
            <div class="box-title">
                <h3>
                    <i class="icon-reorder"></i>

                    @Model.Group.GroupName Group
                </h3>
                <div class="actions">


                    @*<a href="@Url.Action("EditGroup", new{id=Model.GroupId})"><span class="pull-right"><i class="icon-cog"></i></span></a>*@
                    <ul class="" style="list-style: none">
                        <li class="dropdown sett">
                            <a data-toggle="dropdown" class="dropdown-toggle" href="#"><i class="icon-cog"></i></a>
                            <ul class="dropdown-menu pull-right theme-settings">

                                <li>
                                    <a href="@Url.Action("RemoveGroup", new{id=Model.Group.GroupId})" onclick="confirm('Are you sure, you want to leave this group???')">
                                        Leave Group
                                    </a>
                                </li>
                                @if (UtilityService.IsGroupAdmin(Model.Group.GroupId))
                                {
                                    <li>

                                        <a href="@Url.Action("EditGroup", new{id=Model.Group.GroupId})"> settings</a>
                                    </li>
                                }



                            </ul>
                        </li>
                    </ul>


                </div>
            </div>

            <div class="box-content nopadding">
                <div class="span12">
                    <ul class="tabs tabs-inline tabs-top">
                        <li class="active">
                            <a data-toggle="tab" href="#profile"><i class="icon-user"></i> @Model.Group.GroupName</a>
                        </li>
                        <li class="">
                            <a data-toggle="tab" href="#Members"><i class="icon-user"></i> Members</a>
                        </li>
                        <li class="">
                            <a data-toggle="tab" href="#security"><i class="icon-picture"></i> Photos</a>
                        </li>
                        <li class="">
                            <a data-toggle="tab" href="#security"><i class="icon-lock"></i> Events</a>
                        </li>
                    </ul>
                    <div class="tab-content padding tab-content-inline tab-content-bottom">
                        <div id="profile" class="tab-pane active">
                              
                            @Html.Partial("_PartialFeedGroup",Convert.ToString(Model.Group.GroupId))
                           
             
                        </div>
                        <div id="Members" class="tab-pane">
                            @Html.Action("MemberList", new { groupId = Model.Group.GroupId })

                        </div>
                        <div id="security" class="tab-pane">
                            Photos
                        </div>
                    </div>
                    <div class="span3" style="padding-top: 10px">

                        <div>

                            <ul class="" style="list-style: none">
                                <li class="breadcrumbs">

                                    About
                                </li>
                                <li><i class="icon-lock"></i> &nbsp;   @Model.Group.Type Group</li>


                                <li><i class="icon-user"></i> &nbsp;  @UtilityService.GroupMemberCount(Model.Group.GroupId) Members</li>

                            </ul>
                        </div>

                        <div class="control-group">
                            <label for="textfield" class="control-label"><h6>Invite Friend</h6></label>

                            @using (Html.BeginForm("AddGroupMember", "Group", method: FormMethod.Post))
                            {
                                @Html.HiddenFor(x => x.Group.GroupId)

                                <div class="controls">
                                    <select style="width: 225px" name="member" id="s2" class='select2-me input-mini'>
                                        @foreach (var item in list)
                                        {
                                            <option value="@item">

                                                @UtilityService.GetCurrentUserFullName(item)

                                            </option>
                                        }

                                    </select><input type="submit" class="btn btn-grey btn-mini" value="Add" />
                                </div>
                            }
                        </div>
                    </div>
                </div>

            </div>
        </div>

    </div>
</div>
